<?php

namespace App\Admin\Renderable;

use App\Models\GrGood;
use Dcat\Admin\Support\LazyRenderable;
use Dcat\Admin\Widgets\Table;

class StoreDetails extends LazyRenderable
{

    public function render()
    {
        // 获取ID
        $id = $this->product_id;
        $data = GrGood::where('goods_id', $id)->get(['goods_id', 'goods_name', 'goods_now_price']);
        $data = $data->toArray();

        $titles = [
            '商品ID',
            '商品名称',
            '商品实际价格',
        ];

        return Table::make($titles, $data);
    }


}
